#include "DeclareFile.h"
#include<stdio.h>
#include<easyx.h>
#include<graphics.h>
#include<mmsystem.h>

#pragma comment(lib, "winmm.lib")

//游戏主菜单展示
// 播放音乐
void BGM()
{
	mciSendString("open ../Button/field_theme_2.wav alias bgm", NULL, 0, NULL);
	mciSendString("play bgm", NULL, 0, NULL);

}
void MenuView()
{
	BeginBatchDraw();
	HWND hwd = GetHWnd();
	SetWindowText(hwd, _T("类吸血鬼"));
	//修改窗口标题
	//加载背景图片资源
	IMAGE imgBK;
	loadimage(&imgBK, ("../Button/Tilted_Fields.jpg"));
	putimage(0, 0, &imgBK);
	//加载游戏名字
	//printf("类吸血鬼");
	settextstyle(80, 60, "楷体");
	settextcolor(RED);
	setbkmode(TRANSPARENT);
	outtextxy(180, 110, "类吸血鬼");

	IMAGE imgeHover, imgRank;
	loadimage(&imgeHover, ("../Button/Hover.png"), 152, 50);
	loadimage(&imgRank, ("../Button/排行榜.png"), 50, 50);
	putimage(x_, y_ + 55, &imgeHover);
	putimage(x_, y_ + 56 * 2, &imgeHover);
	putimage(x_, y_ + 55 * 3, &imgeHover);
	putimage(x_ - 285, 480, &imgRank);
	//插图

	settextcolor(RED);
	settextstyle(0, 0, _T("微软雅黑"));
	outtextxy(x_ + hSpace, y_ + 60 + vSpace, _T("开始游戏"));

	hSpace = (w - textwidth(_T("设置游戏"))) / 2;
	vSpace = (h - textheight(_T("设置游戏"))) / 2;
	outtextxy(x_ + hSpace, y_ + 60 * 2 + vSpace, _T("设置游戏"));

	hSpace = (w - textwidth(_T("退出游戏"))) / 2;
	vSpace = (h - textheight("退出游戏")) / 2;
	outtextxy(x_ + hSpace, y_ + 60 * 3 + vSpace, "退出游戏");

	outtextxy(x_ - 290, 530, "排行榜");

	FlushBatchDraw();


}